def permutation_1(input, output):
    for a in input:
        if a not in output:
            output.append(a)
            if len(output) == len(input):
                yield output
            else:
                for k in permutation_1(input, output):
                    yield k
            output.pop()


